<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<title>分类信息</title>
		<link rel="stylesheet" href="${ctx}/assets/css/amazeui.min.css" />
		<link rel="stylesheet" href="${ctx}/assets/css/app.css">
		<link rel="stylesheet" href="${ctx}/assets/css/layer.css">
		<link rel="stylesheet" href="${ctx}/assets/css/bootstrap.min.css">
		<link rel="stylesheet" href="${ctx}/assets/css/taskRegister.css">
		<link rel="stylesheet" href="${ctx}/assets/css/xcConfirm.css"/>
		<link rel="stylesheet" href="${ctx}/assets/css/select2.min.css">
	</head>
	<body>
		<div class="form-main">
			<div class="form-header">
				<h4>分组信息</h4>
			</div>
			<div class="content">
				<form id ='addHostGroup'>
				<label for="name">分组名称</label>
				<input type="text" id="name" class="form-control" placeholder="分类名称" name='hostGroupName'>
<!-- 				<label for="introduction">描述</label> -->
<!-- 				<input id="introduction" type="text" class="form-control"> -->
				<label for="mySelect2">选择计算节点</label>
				<select id="mySelect2" class="js-example-basic-multiple js-states form-control" multiple="multiple" name='hosts'>
				</select>
				</form>
			</div>
			<hr>
			<div class="action mr20" style="float: right;" id="closeIframe" onclick='closeIframe();'>
				<ul class="actions-btn"><li class="green">取消</li></ul>
			</div>
			<div class="action mr20" style="float: right;" id="saveCategory" onclick='saveGroup();'>
				<ul class="actions-btn"><li class="green">保存</li></ul>
			</div>
		</div>

	<script src="${ctx}/assets/js/jQuery/jquery.min.js"></script>
	<script src="${ctx}/assets/js/jQuery/jquery-1.9.1.js"></script>
	<script src="${ctx}/assets/js/common/xcConfirm.js"></script>
	<script src="${ctx}/assets/js/common/config.js"></script>
	<script src="${ctx}/assets/js/common/select2.full.js"></script>
	<script src="${ctx}/assets/js/node/NCRegister.js"></script>
	<script src="${ctx}/assets/js/layer/layer.js"></script>
	<script>
        $.ajax({
            type:"POST",
            url:constUrl+"HostServlet",
            dataType:"json",
            data: {
                operateType : "getAllHostName",
            },
            success:function(data){
                var temp = "";
                for (var i=0; i<data.hostName.length; i++) {
                    temp += '<option value="' + data.hostName[i] + '">' + data.hostName[i] + '</option>';
                }
                $("#mySelect2").html(temp);
            },
            error:function (e) {
                console.log(e);
            }
        });
        $('#mySelect2').select2({
            placeholder: '请选择计算节点！'
        });
	</script>
	</body>
</html>